package com.ce.server.util;

import com.ce.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 获取当前系统登录用户
 *
 * @DATE: 2021/11/14 19:19
 * @Author: 小爽帅到拖网速
 */
public class AdminUtil {

  public static UserDetails getCurrentAdmin(){
    return ((UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
  }
 }
